package com.nassir.chatroom.engine;

import java.io.IOException;

import com.nassir.chatroom.client.TalkClient;
import com.nassir.chatroom.constant.Constant;
import com.nassir.chatroom.frame.LoginFrame;
import com.nassir.chatroom.socket.Message;
import com.nassir.chatroom.util.Logs;

/**
 * 客户端
 * 
 * @author nassir.wen
 * @date 2012-12-7下午4:35:21
 * @Company: MSD.
 * @Copyright: Copyright (c) 2012
 */
public class ClientEngine {

	
	public static void main(String[] args) {
		new LoginFrame();
	}

	/**
	 * 登录
	 * @author nassir.wen
	 * @date 2012-12-7下午5:23:26
	 * @param name
	 */
	public static void login(String name) {
	    TalkClient.connect();
		try {
			Message.sendMessage(TalkClient.socketClient, Constant.SET_CHAT_NAME + Constant.$ + name);
		} catch (IOException e) {
			Logs.error("服务器已断开",e);
			
		}
	}
}
